#include "widget.h"
#include "ui_widget.h"
#include<QResizeEvent>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    ui->dial->setValue(100);
    ui->label_2->setGeometry(0,0,800,600);
    QPixmap pixmap(":/1.gif");
    ui->label_2->setPixmap(pixmap);
    ui->label_2->setScaledContents(true);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::Widget::resizeEvent(QResizeEvent *event)
{
    ui->label_2->setGeometry(0,0,event->size().width(),event->size().height());
}


void Widget::on_dial_valueChanged(int value)
{
    this->setWindowOpacity(double(value)/100);
    ui->label->setText("当前的不透明度为："+QString::number(value));
}
